<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<script type="text/javascript">window.onerror = function() { return true; };</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script src="http://connect.facebook.net/zh_TW/all.js"></script>

<script type="text/javascript">
var fbloaded = false;
var appid = '158801687509970';
var p_user = <?php echo $p_user ?>;
var g_user = <?php echo json_encode($g_user); ?>;
var f = <?php echo $friends ?>;
var f_loaded = false;
var is_register = '<?php echo $is_register ?>';
var is_firstin  = '<?php echo $is_firstin ?>';
var game_url = '<?php echo $game_url ?>';
var is_reload = false;
var flashvars = {};
flashvars.system_helpmoney 	= system_helpmoney;
flashvars.is_register 		= <?php ___P((int)(date('Ymd', $user['mtime']) == date('Ymd'))) ?>;
flashvars.is_firstin 		= is_firstin;

flashvars.appid		= '13';
flashvars.mnick 	= p_user.name;
flashvars.sex		= p_user.sex;
flashvars.actswitch = {};
flashvars.actswitch.payment = 1;

flashvars.avatar	= {};
flashvars.avatar.icon	= "http://graph.facebook.com/"	+ p_user.puid + "/picture";
flashvars.avatar.middle	= "http://graph.facebook.com/"	+ p_user.puid + "/picture?type=small";
flashvars.avatar.big	= "http://graph.facebook.com/"	+ p_user.puid + "/picture?type=normal";


<?php
foreach($fv as $k => $v) {
	echo "flashvars.$k = " . json_encode($v) . ";
";
}
?>

flashvars.urls.homepage = 'http://www.facebook.com/profile.php?id=' + p_user.puid;

function get_userdata() {
	return flashvars;
}

function get_history() { //获取右上角的历史信息的方法
	return <?php echo json_encode($user_winlog_histroy) ?>;
}

swfobject.embedSWF(
	'<?php echo $dice_swf_path ?>',
	"flashcontent",
	"760",
	"610",
	"9.0.0",
	"expressInstall.swf",
	{},
	{
		"allowScriptAccess": "always",
		"allowFullScreen": "true",
		"wmode": "transparent"
	}
);
<?php include_once 'main.js'; ?>
</script>
<style type="text/css">
/*<?php include_once 'main.css'; ?>*/
</style>
</head><body>

<?php include_once 'main.html'; ?>

<div id="fb-root"></div>
<script type="text/javascript"><!--

//var facebox_timeout_handle;
//var add2fans_type = '';
//function loadinit() {
//	if(fbloaded) return false;
//	fbloaded = true;
//
//	// check isfan
//	FB.api({ method: 'pages.isFan', page_id: appid }, function(resp) {
//		var isFan = resp ? '1' : '0';
//		var loFan = flashvars.is_fans > 0 ? '1' : '0';
//		if(isFan != loFan) {
//			'1' == isFan ? add2fans() : del1fans();
//			flashvars.is_fans = isFan;
//		}
//	});
//
//	FB.api('/me', loaded_user);
//
//	FB.Data.query('SELECT uid, name, is_app_user FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me());').wait(function(rows) {
//		$.each(rows, function(k, v){
//			v.is_apped = v.is_app_user;
//			delete v.is_app_user;
//			f.push(v);
//		});
//
//		loaded_friends();
//	});
//}
//
//jQuery(document).ready(function(){
//	goGame();
//
//	// init
//	FB.init({appId: appid, status: true, cookie: true, xfbml: false});
//	setTimeout(function(){
//	    FB.Canvas.setSize({"height":$("body").height(),"width":760});
//	    FB.Canvas.setAutoResize(10);
//	},3000);
//	FB.Canvas.setAutoResize(10);
//
//	FB.getLoginStatus(function(response) {
//		if(response.status != 'connected') {
//			FB.Event.subscribe('auth.login', function(response) {
//				loadinit();
//			});
//			FB.login(function(){}, {perms:'email,publish_stream'});
//		}
//		else {
//			loadinit();
//		}
//	});
//
//
//	jQuery(".tabs a").click(function(){
//		$(this).parent().addClass("c").siblings().removeClass("c");
//	});
//
//	jQuery(document).bind("close.facebox", function (event, message1, message2) {
//		hideContainer();
//		window.clearTimeout(facebox_timeout_handle);
//	});
//
//
//});
--></script>


<div style="position: absolute;top:-10000px;">
<form id="reload_form" action="" target="_self" method="post">
<?php foreach($_REQUEST as $n => $req) :?>
<input type="hidden" name="<?php echo $n ?>" value="<?php echo $req ?>" />
<?php endforeach; ?>
</form>
</div>
<div id="track-root" style="height: 1px; position: absolute;top:-10000px;"></div>

<?php if(ujn::getCFG(CFG_IS_ADMIN)) ___INCLUDE('main.admin.php'); ?>

</body>
</html>
